--- This is an undocumented module
module tests.qc.Regexes where

import Test.QuickCheck


o_replaceFst = once ("zzzdogzzzdogzzz".replaceFirst  ´dog´ "cat" == "zzzcatzzzdogzzz")
o_replaceAll = once ("zzzdogzzzdogzzz".replaceAll    ´dog´ "cat" == "zzzcatzzzcatzzz")
o_correct = once ("dogs fear cats".replaceFirst '(\w+) (\w+) (\w+)' "$3 $2 $1" == "cats fear dogs")

o_match   = once ("foobar" ~ '(.)\1')
o_result  = once expr
    where 
        expr = (_.match <$> "foobar" =~ '(.)\1') == Just "oo"
o_tilde2  = once ("foobar" ~~ '(.)\1' == Just "oo")
o_tilde3  = once (map ("frege" ~~~ ´(..).(..)´) [0..3] 
                == [Just "frege", Just "fr", Just "ge" , Nothing])
o_tilde2star = once $
    "cats and dogs are not concatenated." ~~* ´cat|dog´ == ["cat", "dog", "cat"]

o_nomatch = once ("foobar" !~ '(.)\1\1')
p_not = property (\s -> !(s ~ '(.)\1') == (s !~ '(.)\1'))